<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>16_指令</title>
    <style>
        [v-cloak]{
            display: none;
        }
    </style>
</head>
<body>
    <div id="demo">
        <p ref="content">锄禾日当午</p>
        <button @click="tips">提示</button>
        <p>{{msg}}</p>
        <p v-cloak>{{msg}}</p>
    </div>
</body>
<script type="text/javascript" src="../vue.js"></script>
<script>
    alert('----');
    const vm = new Vue({
       el:'#demo',
        data:{
          msg:'李白'
        },
        methods:{
           tips(){
                alert(this.$refs.content.innerText)
           }
        }

    });
</script>
</html>